import { Connector } from "cax-connector"

export function mouseDown(connector: Connector, ev: MouseEvent) {
    const isRight = ev.button === 2
    if (isRight) {
        connector.client.emit("RightButtonPress", {
            x: ev.offsetX,
            y: ev.offsetY,
        })
    } else {
        connector.client.emit("LeftButtonPress", {
            x: ev.offsetX,
            y: ev.offsetY,
            ctrl: ev.ctrlKey ? "1" : "0",
            shift: ev.shiftKey ? "1" : "0",
        })
    }
}
